Skip to content

Conversation

@sakethkotamraju
Copy link

Summary

https://linear.app/coinbase/issue/BA-2211/wsdk-update-the-sdk-constructor-to-accept-the-new-originverification

Added the optional originVerification property to the MWPClient sdk, as well as the EIP1193Provider, and the wagmi constructor. Made a dummy getNonce function (which we will replace to call the actual API) that returns a uuid. Wrote some testing code for it in the MWPClient.test.ts file.

How did you test your changes?

Added testing code for it in the MWPClient.test.ts and ran yarn test to ensure everything passed.

@montycheese montycheese self-requested a review July 2, 2025 18:26
* Request a nonce for origin verification
* @returns Promise<string> - The nonce provided by the wallet
*/
async getNonce(): Promise<string> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm we probably don't need this func if we have MWPClient.request({ method: 'wallet_getNonce' })?

type MWPClientOptions = {
metadata: AppMetadata;
wallet: Wallet;
originVerification?: OriginVerification;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's use the name domainVerification instead. It's more consistent with how we're talking about this feature in other places

Comment on lines 160 to 162
case 'wallet_getNonce':
// For now, generate a UUID locally instead of calling the wallet API
return crypto.randomUUID();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we actually need to define it here. A developer won't need to wallet_getNonce directly. Rather our SDK will call our own nonce endpoint and pass it into the generateDomainSignature function that the developer supplies

Copy link
Collaborator

@fan-zhang-sv fan-zhang-sv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

console.log(` • ${jwksPath} - JWKS file for your domain`);
console.log(` • ${privateKeyPath} - Private key (keep this secure!)\n`);

console.log('🌐 Next steps:');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think it makes sense to have these log in the script tho, maybe we can disable this rule for /scripts/ folder?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to remove them because they kept failing the CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants